title building setup for VS %1


@echo year: %1 version: %2 path: %3 project: %4


IF DEFINED PROGRAMFILES(x86) (
REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%2.0\Setup\VS /v environmentpath
) else (
REG QUERY HKLM\SOFTWARE\Microsoft\VisualStudio\%2.0\Setup\VS /v environmentpath
)

IF %ERRORLEVEL% NEQ 0 (
@echo VisualStudio %2.0 is not installed, err level = %ERRORLEVEL%
rem pause
rem exit /b 0
goto eof
)
rem pause
cd %3
rmdir /s /q .\DesignPatternsSetup_v%2\Release
rmdir /s /q .\DesignPatternsSetup_v%2\Debug

IF DEFINED PROGRAMFILES(x86) (
call "%PROGRAMFILES(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
) else (
call "%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
)

rem call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

@echo cmd to be executed : designpatterns_v10.sln  /rebuild "Release|x86" /project %4_v%2
devenv designpatterns_v10.sln  /rebuild "Release|x86" /project %4_v%2

IF %ERRORLEVEL% NEQ 0 (
color F2
@echo err level = %ERRORLEVEL%
rem exit /b 2
)
cd ./Misc
rem cls
